package io.file;

import java.io.File;

/**
 * @program: javase
 * @description: 文件查找操作
 * @author: luolidong
 * @create: 2021-07-01 11:05
 * @version: 1.0
 */
public class FileTest {
    private static final String url="./other/src";//指定文件夹路径

    public static void main(String[] args) {
        //创建自定义文件过滤类对象
        MyFileFilter myFileFilter = new MyFileFilter();
        File file1 = new File(url);
        String[] list2 = file1.list();
        for (int i = 0; i <list2.length ; i++) {
            if(myFileFilter.accept(file1, list2[i])){
                System.out.println(list2[i]);
            }
        }
    }
}
